<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Project;
use App\Bid;
use App\Grow;
use App\Hk;

use Auth;

class HomeController extends Controller
{
    protected $uid;

    

    public function __construct(){
        $this->uid = Auth::user()->uid;
    }

    public function mydk(){
        $pros = Project::where('uid',$this->uid)->get();
        return view('mydk',['pros'=>$pros]);
    }
    
    public function mytz(){
        $bids = Bid::where('uid',$this->uid)->get();
        return view('mytz',['bids'=>$bids]);
    }
    
    public function mylr(){
        $grows = Grow::where('uid',$this->uid)->paginate(3);
        return view('mylr',['grows'=>$grows]);
    }
    
    public function myzd(){
        $hks = Hk::where('uid',$this->uid)->orderBy('paydate')->get();
        return view('myzd',['hks'=>$hks]);
    }

}
